package com.stenio.fancat.util;

import javax.servlet.http.HttpServletRequest;

public class RequestUtil {

    public static final String X_FORWARDED_FOR = "X-Forwarded-For";

    public static String getRemoteIp(HttpServletRequest request) {
        if (!StringUtil.isEmpty(request.getHeader(X_FORWARDED_FOR))) {
            return request.getHeader(X_FORWARDED_FOR);
        }
        return request.getRemoteAddr();
    }
}
